
export const crudOptions = vm => {
  return {
    pageOptions: {
      compact: true
    },
    rowHandle: false,
    options: {
      tableType: 'vxe-table',
      rowKey: true, // 必须设置，true or false
      rowId: 'id',
      height: '100%', // 表格高度100%, 使用toolbar必须设置
      highlightCurrentRow: false
    },
    indexRow: {
      // 或者直接传true,不显示title，不居中
      title: '序号',
      align: 'center',
      width: 100
    },
    viewOptions: {
      componentType: 'form'
    },
    formOptions: {
      defaultSpan: 24, // 默认的表单 span
      width: '35%'
    },
    columns: [{
      title: 'ID',
      key: 'id',
      show: false,
      disabled: true,
      width: 90,
      form: {
        disabled: true
      }
    },
    {
      title: '关键字',
      key: 'search',
      show: false,
      disabled: true,
      search: {
        disabled: false
      },
      form: {
        disabled: true,
        component: {
          placeholder: '请输入关键词'
        }
      },
      view: {
        disabled: true
      }
    },
    {
      title: 'VIN',
      key: 'vin',
      treeNode: true,
      type: 'input',
    },
    {
      title: '故障码',
      key: 'fault_code',
      type: 'select',
    },
    {
      title: '开始报警时间',
      key: 'start_time',
      type: 'input',
    },
    {
      title: '结束报警时间',
      key: 'end_time',
      type: 'input',
    },
    {
      title: '处理人',
      key: 'process_by',
      type: 'input',
    },
    {
      title: '处理时间',
      key: 'process_time',
      type: 'input',
    }
    ].concat(vm.commonEndColumns({ update_datetime: { showForm: false, showTable: false }, create_datetime: { showForm: false, showTable: false } }))
  }
}
